home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / src / menu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  1.6 KB  |  66 lines

  1. #ifndef __MENU_H
  2. #define __MENU_H
  3.  
  4. /* IMPORTANT NOTE: This header is dependent on HAVE_X / HAVE_XVIEW. If you
  5.  * include this header, you have to move it to the group of HAVE_X dependant
  6.  * modules in {xv|tk}/Makefile.in !!!
  7.  */
  8.  
  9. #include "dlg.h"
  10. #include "widget.h"
  11.  
  12. typedef void (*callfn) ();
  13. /* FIXME: We have to leave this type ambiguous, because `callfn' is
  14.    used both for functions that take an argument and ones that don't.
  15.    That ought to be cleared up. */
  16.  
  17. typedef struct {
  18.     char first_letter;
  19.     char *text;
  20.     int  hot_key;
  21.     callfn call_back;
  22. } menu_entry;
  23.  
  24. #ifdef HAVE_XVIEW
  25. #   ifndef xview_walkmenu_DEFINED
  26.         typedef unsigned long Menu;
  27. #   endif
  28. #else
  29. typedef struct {
  30.     char   *name;
  31.     int    count;
  32.     int    max_entry_len;
  33.     int    selected;
  34.     menu_entry *entries;
  35. } sMenu;
  36. typedef sMenu *Menu;
  37. #endif
  38.  
  39. Menu create_menu (char *name, menu_entry *entries, int count);
  40. #ifdef HAVE_XVIEW
  41.     void destroy_menu (Menu menu);
  42. #else
  43. #   define destroy_menu(x) free(x)
  44. #endif
  45.  
  46. extern int menubar_visible;
  47.  
  48. /* The button bar menu */
  49. typedef struct {
  50.     Widget widget;
  51.  
  52.     int    active;        /* If the menubar is in use */
  53.     int    dropped;        /* If the menubar has dropped */
  54.     Menu   *menu;        /* The actual menus */
  55.     int    items;
  56.     int    selected;        /* Selected menu on the top bar */
  57.     int    subsel;        /* Selected entry on the submenu */
  58.     int    max_entry_len;    /* Cache value for the columns in a box */
  59.     int    previous_selection;    /* Selected widget before activating menu */
  60. } WMenu;
  61.  
  62. WMenu *menubar_new (int y, int x, int cols, Menu menu [], int items);
  63.  
  64. #endif /* __MENU_H */
  65.  
  66.